<?php 
/**
  * @version $Id: mojo.php, v 0.16 2007/25/07 11:55:55 visualweb Exp $ 
  * @package com_mojo
  * @copyright (c) 1guywebdesign.com 
  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL 
  *
  */

/** ensure this file is being included by a parent file */
defined('_JEXEC') or die('Restricted Access');//1.5
//defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
$basiccontroller = JPATH_COMPONENT.DS.'controller.php';
		
if(file_exists($basiccontroller)){
	require_once ($basiccontroller);
	require_once (JPATH_COMPONENT.DS.'models'.DS.'default.php');
	// Require specific controller if requested
	if($ucontroller = JRequest::getWord('controller', 'application')) {
		$path = JPATH_COMPONENT.DS.'controllers'.DS.$ucontroller.'.php';
		if (file_exists($path)) {
			require_once ($path);
		} else {
			$ucontroller = '';
		}
	}
	// Create the controller
	$classname	= 'JWPBlogController'.ucfirst($ucontroller);
	$controller	= new $classname( );
	$controller->execute( JRequest::getCmd('task'));
	$controller->redirect();		
}else{
	global $mosConfig_absolute_path;
	require_once( $mainframe->getPath( 'front_html' ) );
	$pageid		= (int) mosGetParam( $_REQUEST ,'page_id', 0 );

	if ($pageid > 0) {
		HTML_wp::wp_page();
	} else {
		HTML_wp::wp_main();	
	}
}
?>